programming - C - function strftimeWhat links here?
size_t strftime ( char * ptr, size_t maxsize, const char * format, const struct tm * timeptr );
Format time to string

Copies into ptr the content of format, expanding its format tags into the corresponding values as specified by timeptr, with a limit of maxsize characters.



Parameters



specifier Replaced by Example
%a Abbreviated weekday name * Thu
%A Full weekday name * Thursday
%b Abbreviated month name * Aug
%B Full month name * August
%c Date and time representation * Thu Aug 23 14:55:02 2001
%d Day of the month (01-31) 23
%H Hour in 24h format (00-23) 14
%I Hour in 12h format (01-12) 02
%j Day of the year (001-366) 235
%m Month as a decimal number (01-12) 08
%M Minute (00-59) 55
%p AM or PM designation PM
%S Second (00-61) 02
%U Week number with the first Sunday as the first day of week one (00-53) 33
%w Weekday as a decimal number with Sunday as 0 (0-6) 4
%W Week number with the first Monday as the first day of week one (00-53) 34
%x Date representation * 08/23/01
%X Time representation * 14:55:02
%y Year, last two digits (00-99) 01
%Y Year 2001
%Z Timezone name or abbreviation CDT
%% A % sign %




Return Value

If the resulting C string fits in less than maxsize characters including the terminating null-character, the total number of characters copied to ptr (not including the terminating null-character) is returned. Otherwise, zero is returned and the contents of the array are indeterminate.

Portability

This description corresponds to the C++ version of this function (which is the same as in the ISO-C Standard of 1990). C compilers may support additional specifiers and modifiers for the format parameter of this function, which are not described here.

www.cplusplus.com
programming - C - function strftime
filename:programming - C - function strftime
filename:programming%20%2D%20C%20%2D%20function%20strftime
last edit:October 09 2009 17:43:44 (5322 days ago)
ct = 1714949786.000000 = May 05 2024 18:56:26
ft = 1255124624.000000 = October 09 2009 17:43:44
dt = 459825162.000000